part of markdown;

class _Tx {
  static String get photos => "photos";
  static String get body => "body";
  static String get sub => "sub";
  static String get title => "title";
  static String get md => "main.md";
}

extension LineCut on List {
  List<String> _cut(RegExp rule) {
    List<String> _line = [];
    for (String text in this) {
      List<String> unmatch = text.split(rule);
      List<String> match =
          rule.allMatches(text).map((e) => e.group(0)!).toList();

      List<String> out = [unmatch.first];
      for (int i = 0; i < match.length; i++) {
        out.add(match[i]);
        out.add(unmatch[i + 1]);
      }

      _line.add(out.where((e) => e.isNotEmpty).join("><"));
    }
    return _line;
  }
}
